﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace CRM_Project
{
    public partial class AgentMain : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void search_button_Click(object sender, EventArgs e)
        {
            LinqDataSource1.AutoGenerateWhereClause = true;
            LinqDataSource1.WhereParameters.Clear();

            if (carID_textbox.Text != "")
                LinqDataSource1.WhereParameters.Add("ID", TypeCode.Int32, carID_textbox.Text);

            if (model_textbox.Text != "")
                LinqDataSource1.WhereParameters.Add("Model.Name", model_textbox.Text);

            if (lot_textbox.Text != "")
                LinqDataSource1.WhereParameters.Add("Lot.Name", lot_textbox.Text);

            if (status_textbox.Text != "")
                LinqDataSource1.WhereParameters.Add("Status.Description", status_textbox.Text);

            DataBind();
            vehicle_gridview.Visible = true;
        }

        
    }
}
